<form id="<?php echo $uniqid;?>" method="post" style="padding: 0;">
    <table border="0" cellspacing="1" cellpadding="5" class="formtable" style="margin-bottom: 100px;">
        <tr bgcolor="#FFFFFF">
            <td colspan="2" style="text-align: left">
                    <div style="padding: 10px 40px;">
                        <div class="display-flex" style="margin-bottom:10px">
                            <div class="goods-image" v-if="goodsDetail.image">
                                <el-image :src="goodsDetail.image" fit="container">
                                    <div slot="error" class="image-slot">
                                        <i class="el-icon-picture-outline"></i>
                                    </div>
                                </el-image>
                            </div>
                            <div class="goods-title">
                                {{goodsDetail.title}}
                            </div>
                        </div>
                    </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td style="text-align: left; max-width: 200px; width: 200px">
                <b>产品参与分红</b>
            </td>
            <td>
                <div class="display-flex">
                    <div>是否参与：</div>
                    <el-radio-group v-model="params.status">
                        <el-radio :label="0">不参与</el-radio>
                        <el-radio :label="1">参与</el-radio>
                    </el-radio-group>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" v-if="params.status==1">
            <td><b>代理分红设置</b></td>
            <td>
                <div class="display-flex">
                    <div>是否参与：</div>
                    <el-radio-group v-model="params.jc_status">
                        <el-radio :label="0">不参与</el-radio>
                        <el-radio :label="1">参与</el-radio>
                    </el-radio-group>
                </div>
                <div class="display-flex" v-if="params.jc_status==1">
                    <div>分红规则：</div>
                    <el-radio-group v-model="params.jc_self_rules">
                        <el-radio :label="0">默认规则</el-radio>
                        <el-radio :label="1">独立规则</el-radio>
                    </el-radio-group>
                </div>
                <div style="padding: 10px 0;" v-if="params.jc_status==1">
                    <div v-if="params.jc_self_rules==0" style="overflow: auto;">
                        <div class="display-flex goods-header commission-header-container">
                            <div class="commission-store-name">代理身份名称</div>
                            <div class="commission-item">分红比例</div>
                        </div>
                        <div class="display-flex goods-body-item commission-body-container"
                             v-for="levelItem in levelList">
                            <div class="commission-store-name">
                                {{levelItem.name}}
                            </div>
                            <div class="commission-item">
                                {{levelItem.commission_rules}}%
                            </div>
                        </div>
                    </div>
                    <div v-if="params.jc_self_rules==1" style="overflow: auto;">
                        <div class="display-flex commission-header-container">
                            <div class="commission-store-name">代理身份名称</div>
                            <div class="commission-item">
                                分红比例
                            </div>
                        </div>
                        <div class="alone-setting-container">
                                <div class="display-flex">
                                    <div>
                                        <!-- 身份 -->
                                        <div class="commission-store-name" style="height: 50px; line-height: 50px;" v-for="(levelItem,level) in levelList">
                                            {{levelItem.name}}
                                        </div>
                                    </div>
                                    <div>
                                        <div v-for="(commissionitem,index1) in commission_rules">
                                            <div class="display-flex commission-item">
                                                <div class="sku-price-ratio">
                                                    <el-input v-model="commissionitem.ratio" size="mini" v-enter-number @input="inputChange"
                                                              style="width:120px" :disabled="!!commissionitem.money">
                                                        <template slot="append">%</template>
                                                    </el-input>
                                                </div>
                                                <div class="sku-price-money">
                                                    <el-input v-model="commissionitem.money" size="mini"
                                                              style="width:120px" v-enter-number
                                                              @input="inputChange"
                                                              :disabled="!!commissionitem.ratio">
                                                        <template slot="append">元</template>
                                                    </el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" v-if="params.status==1">
            <td><b>平级分红设置</b></td>
            <td>
                <div class="display-flex">
                    <div>是否参与：</div>
                    <el-radio-group v-model="params.pj_status">
                        <el-radio :label="0">不参与</el-radio>
                        <el-radio :label="1">参与</el-radio>
                    </el-radio-group>
                </div>
                <div class="display-flex" v-if="params.pj_status==1">
                    <div>分红规则：</div>
                    <el-radio-group v-model="params.pj_self_rules">
                        <el-radio :label="0">默认规则</el-radio>
                        <el-radio :label="1">独立规则</el-radio>
                    </el-radio-group>
                </div>
                <div style="padding: 10px 0;" v-if="params.pj_status==1">
                    <div v-if="params.pj_self_rules==0">
                        <div class="display-flex goods-header commission-header-container">
                            <div class="commission-store-name">代理身份名称</div>
                            <div class="commission-item">平一分红比例</div>
                            <div class="commission-item">平二分红比例</div>
                            <div class="commission-item">平三分红比例</div>
                        </div>
                        <div class="display-flex goods-body-item commission-body-container" v-for="levelItem in levelList">
                            <div class="commission-store-name">
                                {{levelItem.name}}
                            </div>
                            <div class="commission-item">
                                    <span v-if="levelItem.award_ping1">
                                        <span v-if="levelItem.award_ping1.money">金额：￥{{levelItem.award_ping1.money}}</span>
                                        <span v-if="levelItem.award_ping1.ratio">比例 ：{{levelItem.award_ping1.ratio}}%</span>
                                    </span>
                                <span v-else>&nbsp;</span>
                            </div>
                            <div class="commission-item">
                                    <span v-if="levelItem.award_ping2">
                                        <span v-if="levelItem.award_ping2.money">金额：￥{{levelItem.award_ping2.money}}</span>
                                        <span v-if="levelItem.award_ping2.ratio">比例 ：{{levelItem.award_ping2.ratio}}%</span>
                                    </span>
                                <span v-else>&nbsp;</span>
                            </div>
                            <div class="commission-item">
                                    <span v-if="levelItem.award_ping3">
                                        <span v-if="levelItem.award_ping3.money">金额：￥{{levelItem.award_ping3.money}}</span>
                                        <span v-if="levelItem.award_ping3.ratio">比例 ：{{levelItem.award_ping3.ratio}}%</span>
                                    </span>
                                <span v-else>&nbsp;</span>
                            </div>
                        </div>
                    </div>
                    <div v-if="params.pj_self_rules==1">
                        <div class="display-flex goods-header commission-header-container">
                            <div class="commission-store-name">代理身份名称</div>
                            <div class="commission-item">平一分红比例</div>
                            <div class="commission-item">平二分红比例</div>
                            <div class="commission-item">平三分红比例</div>
                        </div>
                        <div class="alone-setting-container">
                            <div>
                                <div class="display-flex">
                                    <div>
                                        <!-- 身份 -->
                                        <div class="commission-store-name" style="height: 50px; line-height: 50px;" v-for="(levelItem,level) in levelList">
                                            {{levelItem.name}}
                                        </div>
                                    </div>
                                    <div>
                                        <div v-for="(commissionitem,index1) in pj_level1_rules">
                                            <div class="display-flex commission-item">
                                                <div class="sku-price-ratio">
                                                    <el-input v-model="commissionitem.ratio" size="mini" v-enter-number
                                                              style="width:120px" @input="inputChange" :disabled="!!commissionitem.money">
                                                        <template slot="append">%</template>
                                                    </el-input>
                                                </div>
                                                <div class="sku-price-money">
                                                    <el-input v-model="commissionitem.money" size="mini" v-enter-number
                                                              style="width:120px" @input="inputChange" :disabled="!!commissionitem.ratio">
                                                        <template slot="append">元</template>
                                                    </el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div>
                                        <div v-for="(commissionitem,index1) in pj_level2_rules">
                                            <div class="display-flex commission-item">
                                                <div class="sku-price-ratio">
                                                    <el-input v-model="commissionitem.ratio" size="mini" v-enter-number
                                                              style="width:120px" @input="inputChange" :disabled="!!commissionitem.money">
                                                        <template slot="append">%</template>
                                                    </el-input>
                                                </div>
                                                <div class="sku-price-money">
                                                    <el-input v-model="commissionitem.money" size="mini" v-enter-number
                                                              style="width:120px" @input="inputChange" :disabled="!!commissionitem.ratio">
                                                        <template slot="append">元</template>
                                                    </el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div>
                                        <div v-for="(commissionitem,index1) in pj_level3_rules">
                                            <div class="display-flex commission-item">
                                                <div class="sku-price-ratio">
                                                    <el-input v-model="commissionitem.ratio" size="mini" v-enter-number
                                                              style="width:120px" @input="inputChange" :disabled="!!commissionitem.money">
                                                        <template slot="append">%</template>
                                                    </el-input>
                                                </div>
                                                <div class="sku-price-money">
                                                    <el-input v-model="commissionitem.money" size="mini" v-enter-number
                                                              style="width:120px" @input="inputChange" :disabled="!!commissionitem.ratio">
                                                        <template slot="append">元</template>
                                                    </el-input>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" v-if="params.status==1">
            <td style="text-align: left">
                <b>推客分红设置</b>
            </td>
            <td>
                <div class="display-flex">
                    <div>是否参与：</div>
                    <el-radio-group v-model="params.tk_status">
                        <el-radio :label="0">不参与</el-radio>
                        <el-radio :label="1">参与</el-radio>
                    </el-radio-group>
                </div>
                <div class="display-flex" v-if="params.tk_status==1">
                    <div>分红规则：</div>
                    <el-radio-group v-model="params.tk_self_rules">
                        <el-radio :label="0">默认规则</el-radio>
                        <el-radio :label="1">独立规则</el-radio>
                    </el-radio-group>
                </div>
                <div style="padding: 10px 0;" v-if="params.tk_status==1">
                    <div v-if="params.tk_self_rules==0" style="overflow: auto;width: 800px">
                        <div class="display-flex goods-header commission-header-container">
                            <div class="commission-store-name">推客身份名称</div>
                            <div class="commission-tk-name">直推比例</div>
                            <div class="commission-tk-name">间推比例</div>
                        </div>
                        <div class="display-flex goods-body-item commission-body-container"
                             v-for="levelItem in tuikeLevelList">
                            <div class="commission-store-name">
                                {{levelItem.name}}
                            </div>
                            <div class="commission-tk-item">
                                {{levelItem.award_zhitui}}%
                            </div>
                            <div class="commission-tk-item">
                                {{levelItem.award_jiantui}}%
                            </div>
                        </div>
                    </div>
                    <div v-if="params.tk_self_rules==1" style="overflow: auto;width: 800px">
                        <div class="display-flex commission-header-container">
                            <div class="commission-store-name">推客身份名称</div>
                            <div class="commission-tk-name">
                                直推比例
                            </div>
                            <div class="commission-tk-name">
                                间推比例
                            </div>
                        </div>
                        <div class="alone-setting-container">
                            <div class="display-flex">
                                <div>
                                    <!-- 身份 -->
                                    <div class="commission-store-name" style="height: 50px; line-height: 50px;" v-for="(levelItem,level) in tuikeLevelList">
                                        {{levelItem.name}}
                                    </div>
                                </div>
                                <div>
                                    <div v-for="(commissionitem,index1) in tuike_zhitui_rules">
                                        <div class="display-flex commission-tk-item">
                                            <div class="sku-price-ratio">
                                                <el-input v-model="commissionitem.ratio" size="mini" v-enter-number @input="inputChange"
                                                          style="width:120px" :disabled="!!commissionitem.money">
                                                    <template slot="append">%</template>
                                                </el-input>
                                            </div>
                                            <div class="sku-price-money">
                                                <el-input v-model="commissionitem.money" size="mini"
                                                          style="width:120px" v-enter-number
                                                          @input="inputChange"
                                                          :disabled="!!commissionitem.ratio">
                                                    <template slot="append">元</template>
                                                </el-input>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div v-for="(commissionitem,index1) in tuike_jiantui_rules">
                                        <div class="display-flex commission-tk-item">
                                            <div class="sku-price-ratio">
                                                <el-input v-model="commissionitem.ratio" size="mini" v-enter-number @input="inputChange"
                                                          style="width:120px" :disabled="!!commissionitem.money">
                                                    <template slot="append">%</template>
                                                </el-input>
                                            </div>
                                            <div class="sku-price-money">
                                                <el-input v-model="commissionitem.money" size="mini"
                                                          style="width:120px" v-enter-number
                                                          @input="inputChange"
                                                          :disabled="!!commissionitem.ratio">
                                                    <template slot="append">元</template>
                                                </el-input>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" v-if="params.status==1">
            <td style="text-align: left">
                <b>合伙人分红设置</b>
            </td>
            <td>
                <div class="display-flex">
                    <div>是否参与：</div>
                    <el-radio-group v-model="params.gd_status">
                        <el-radio :label="0">不参与</el-radio>
                        <el-radio :label="1">参与</el-radio>
                    </el-radio-group>
                </div>
                <div class="display-flex" v-if="params.gd_status==1">
                    <div>分红规则：</div>
                    <el-radio-group v-model="params.gd_self_rules">
                        <el-radio :label="0">默认规则</el-radio>
                        <el-radio :label="1">独立规则</el-radio>
                    </el-radio-group>
                </div>
                <div style="padding: 10px 0;" v-if="params.gd_status==1">
                    <div v-if="params.gd_self_rules==0" style="overflow: auto;">
                        <div class="display-flex goods-header commission-header-container">
                            <div class="commission-store-name">合伙人身份名称</div>
                            <div class="commission-item">分红比例</div>
                        </div>
                        <div class="display-flex goods-body-item commission-body-container"
                             v-for="levelItem in gudongLevelList">
                            <div class="commission-store-name">
                                {{levelItem.level_info.name}}
                            </div>
                            <div class="commission-item">
                                {{levelItem.commission_rules}}%
                            </div>
                        </div>
                    </div>
                    <div v-if="params.gd_self_rules==1" style="overflow: auto;">
                        <div class="display-flex commission-header-container">
                            <div class="commission-store-name">合伙人身份名称</div>
                            <div class="commission-item">
                                分红比例
                            </div>
                        </div>
                        <div class="alone-setting-container">
                            <div class="display-flex">
                                <div>
                                    <!-- 身份 -->
                                    <div class="commission-store-name" style="height: 50px; line-height: 50px;" v-for="(levelItem,level) in gudongLevelList">
                                        {{levelItem.level_info.name}}
                                    </div>
                                </div>
                                <div>
                                    <div v-for="(commissionitem,index1) in gd_rules">
                                        <div class="display-flex commission-item">
                                            <div class="sku-price-ratio">
                                                <el-input v-model="commissionitem.ratio" size="mini" v-enter-number @input="inputChange"
                                                          style="width:120px" :disabled="!!commissionitem.money">
                                                    <template slot="append">%</template>
                                                </el-input>
                                            </div>
                                            <div class="sku-price-money">
                                                <el-input v-model="commissionitem.money" size="mini"
                                                          style="width:120px" v-enter-number
                                                          @input="inputChange"
                                                          :disabled="!!commissionitem.ratio">
                                                    <template slot="append">元</template>
                                                </el-input>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </td>
        </tr>
<!--        <tr bgcolor="#FFFFFF" v-if="params.status==1">-->
<!--            <td style="text-align: left">-->
<!--                <b>区域分红设置</b>-->
<!--            </td>-->
<!--            <td>-->
<!--                <div class="display-flex">-->
<!--                    <div>是否参与：</div>-->
<!--                    <el-radio-group v-model="params.qd_status">-->
<!--                        <el-radio :label="0">不参与</el-radio>-->
<!--                        <el-radio :label="1">参与</el-radio>-->
<!--                    </el-radio-group>-->
<!--                </div>-->
<!--                <div class="display-flex" v-if="params.qd_status==1">-->
<!--                    <div>分红规则：</div>-->
<!--                    <el-radio-group v-model="params.qd_self_rules">-->
<!--                        <el-radio :label="0">默认规则</el-radio>-->
<!--                        <el-radio :label="1">独立规则</el-radio>-->
<!--                    </el-radio-group>-->
<!--                </div>-->
<!--                <div style="padding: 10px 0;" v-if="params.qd_status==1">-->
<!--                    <div v-if="params.qd_self_rules==0" style="overflow: auto;">-->
<!--                        <div class="display-flex goods-header commission-header-container">-->
<!--                            <div class="commission-store-name">区域代理身份名称</div>-->
<!--                            <div class="commission-item">分红比例</div>-->
<!--                        </div>-->
<!--                        <div class="display-flex goods-body-item commission-body-container"-->
<!--                             v-for="levelItem in qudaiLevelList">-->
<!--                            <div class="commission-store-name">-->
<!--                                {{levelItem.name}}-->
<!--                            </div>-->
<!--                            <div class="commission-item">-->
<!--                                {{levelItem.commission_rules}}%-->
<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                    <div v-if="params.qd_self_rules==1" style="overflow: auto;">-->
<!--                        <div class="display-flex commission-header-container">-->
<!--                            <div class="commission-store-name">区域代理身份名称</div>-->
<!--                            <div class="commission-item">-->
<!--                                分红比例-->
<!--                            </div>-->
<!--                        </div>-->
<!--                        <div class="alone-setting-container">-->
<!--                            <div class="display-flex">-->
<!--                                <div>-->
<!--                                    &lt;!&ndash; 身份 &ndash;&gt;-->
<!--                                    <div class="commission-store-name" style="height: 50px; line-height: 50px;" v-for="(levelItem,level) in qudaiLevelList">-->
<!--                                        {{levelItem.name}}-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                                <div>-->
<!--                                    <div v-for="(commissionitem,index1) in qd_rules">-->
<!--                                        <div class="display-flex commission-item">-->
<!--                                            <div class="sku-price-ratio">-->
<!--                                                <el-input v-model="commissionitem.ratio" size="mini" v-enter-number @input="inputChange"-->
<!--                                                          style="width:120px" :disabled="!!commissionitem.money">-->
<!--                                                    <template slot="append">%</template>-->
<!--                                                </el-input>-->
<!--                                            </div>-->
<!--                                            <div class="sku-price-money">-->
<!--                                                <el-input v-model="commissionitem.money" size="mini"-->
<!--                                                          style="width:120px" v-enter-number-->
<!--                                                          @input="inputChange"-->
<!--                                                          :disabled="!!commissionitem.ratio">-->
<!--                                                    <template slot="append">元</template>-->
<!--                                                </el-input>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                            </div>-->

<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </td>-->
<!--        </tr>-->
    </table>
    <div style="position:absolute;z-index: 9999; bottom:0;width:100%; text-align:right; background-color:#F1f1f1; border:#ccc 1px solid;">
        <div style="padding:2px 15px 2px 10px; float:right;">
            <a href="javascript:void(0);" class="l-btn l-btn-small" @click="submit()"><span
                    class="l-btn-left l-btn-icon-left"><span class="l-btn-text">确定</span><span
                    class="l-btn-icon icon-ok">&nbsp;</span></span></a>
            <a href="javascript:void(0);" class="l-btn l-btn-small" @click="close()"><span
                    class="l-btn-left l-btn-icon-left"><span class="l-btn-text">关闭</span><span
                    class="l-btn-icon icon-no">&nbsp;</span></span></a>
        </div>
    </div>
</form>
<div id="agentbonusdlg" class="easyui-dialog" style="width:840px; height:520px;" title="信息框" closed="true"></div>

<script>
    var agentbonusVm = new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: JSON.parse('<?php echo addslashes($params);?>'),
            levelList: JSON.parse('<?php echo addslashes($levelList);?>'),
            gudongLevelList: JSON.parse('<?php echo addslashes($gudongLevelList);?>'),
            tuikeLevelList: JSON.parse('<?php echo addslashes($tuikeLevelList);?>'),
            qudaiLevelList: JSON.parse('<?php echo addslashes($qudaiLevelList);?>'),
            commission_rules: JSON.parse('<?php echo addslashes($commission_rules);?>'),
            gd_rules: JSON.parse('<?php echo addslashes($gd_rules);?>'),
            qd_rules: JSON.parse('<?php echo addslashes($qd_rules);?>'),
            pj_level1_rules: JSON.parse('<?php echo addslashes($pj_level1_rules);?>'),
            pj_level2_rules: JSON.parse('<?php echo addslashes($pj_level2_rules);?>'),
            pj_level3_rules: JSON.parse('<?php echo addslashes($pj_level3_rules);?>'),
            tuike_zhitui_rules: JSON.parse('<?php echo addslashes($tuike_zhitui_rules);?>'),
            tuike_jiantui_rules: JSON.parse('<?php echo addslashes($tuike_jiantui_rules);?>'),
            goodsDetail: JSON.parse('<?php echo addslashes($goodsDetail);?>'),
        },
        created(){
            this.commission_rules.forEach((it, idx)=>{
                if(!this.levelList.find((obj)=>{
                    return obj.level===it.level;
                })){
                    this.commission_rules.splice(idx, 1);
                }
            });
            this.gd_rules.forEach((it, idx)=>{
                if(!this.levelList.find((obj)=>{
                    return obj.level===it.level;
                })){
                    this.gd_rules.splice(idx, 1);
                }
            });
            this.pj_level1_rules.forEach((it, idx)=>{
                if(!this.levelList.find((obj)=>{
                    return obj.level===it.level;
                })){
                    this.pj_level1_rules.splice(idx, 1);
                }
            });
            this.pj_level2_rules.forEach((it, idx)=>{
                if(!this.levelList.find((obj)=>{
                    return obj.level===it.level;
                })){
                    this.pj_level2_rules.splice(idx, 1);
                }
            });
            this.pj_level3_rules.forEach((it, idx)=>{
                if(!this.levelList.find((obj)=>{
                    return obj.level===it.level;
                })){
                    this.pj_level3_rules.splice(idx, 1);
                }
            });
        },
        methods: {
            init(){

            },
            inputChange() {
                this.$forceUpdate()
            },
            submit: function () {
                if(parseInt(agentbonusVm.params.jc_self_rules)===0){
                    agentbonusVm.params.jc_rules = '';
                }else{
                    agentbonusVm.params.jc_rules = JSON.stringify(this.commission_rules);
                }
                if(parseInt(agentbonusVm.params.gd_self_rules)===0) {
                    agentbonusVm.params.gd_rules = '';
                }else{
                    agentbonusVm.params.gd_rules = JSON.stringify(this.gd_rules);
                }
                if(parseInt(agentbonusVm.params.qd_self_rules)===0) {
                    agentbonusVm.params.qd_rules = '';
                }else{
                    agentbonusVm.params.qd_rules = JSON.stringify(this.qd_rules);
                }
                if(parseInt(agentbonusVm.params.pj_self_rules)===0) {
                    agentbonusVm.params.pj_level1_rules = '';
                    agentbonusVm.params.pj_level2_rules = '';
                    agentbonusVm.params.pj_level3_rules = '';
                }else{
                    agentbonusVm.params.pj_level1_rules = JSON.stringify(this.pj_level1_rules);
                    agentbonusVm.params.pj_level2_rules = JSON.stringify(this.pj_level2_rules);
                    agentbonusVm.params.pj_level3_rules = JSON.stringify(this.pj_level3_rules);
                }
                if(parseInt(agentbonusVm.params.tk_self_rules)===0) {
                    agentbonusVm.params.tk_zhitui_rules = '';
                    agentbonusVm.params.tk_jiantui_rules = '';
                }else{
                    agentbonusVm.params.tk_zhitui_rules = JSON.stringify(this.tuike_zhitui_rules);
                    agentbonusVm.params.tk_jiantui_rules = JSON.stringify(this.tuike_jiantui_rules);
                }
                $.post('/admin/agent/bonus', agentbonusVm.params, function (data) {
                    if (data.ret === 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        agentgoodsReload();
                        $('#<?php echo $uniqid;?>').form('clear');
                        $('#rightTabs').tabs('close', '设置分红');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }, 'json');
            },
            close(){
                $('#rightTabs').tabs('close', '设置分红');
            }
        }
    });
    $(function () {
        $('#agentgoodssubmit').click(function (data) {
            agentbonusVm.submit();
        });
    });
</script>

<style>
    .goods-image {
        width: 60px;
        height: 60px;
        border-radius: 4px;
        border: 1px solid #e6e6e6;
        margin-right: 14px;
    }
    .shopro-form-group-title {
        border-bottom: 1px solid rgb(230, 230, 230);
        height: 50px;
        line-height: 50px;
        font-weight: 600;
        font-size: 14px;
        margin-bottom: 30px;
        display: flex;
        align-items: center;
        padding: 0px 20px;
    }
    .commission-header-container {
        line-height: 40px;
    }
    .commission-header-container .commission-store-name, .commission-header-container .commission-item, .commission-header-container .commission-tk-name,.commission-header-container .commission-sku, .commission-header-container .commission-price {
        border-top: 1px solid #e6e6e6;
        background: #f9f9f9;
    }
    .commission-store-name {
        width: 120px;
        min-width: 120px;
        padding: 0 10px;
        text-align: center;
        border-left: 1px solid #e6e6e6;
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    .commission-body-container {
        line-height: 50px;
        display: flex;
    }
    .commission-item {
        min-width: 320px;
        padding: 0 10px;
        display: flex;
        justify-content: center;
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    .commission-tk-name {
        width: 300px;
        min-width: 300px;
        padding: 0 10px;
        text-align: center;
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    .commission-tk-item {
        width: 300px;
        min-width: 300px;
        padding: 0 10px;
        display: flex;
        justify-content: center;
        border-right: 1px solid #e6e6e6;
        border-bottom: 1px solid #e6e6e6;
    }
    .commission-sku, .commission-price {
        width: 60px;
        min-width: 60px;
        padding: 0 20px;
        border-bottom: 1px solid #e6e6e6;
        border-right: 1px solid #e6e6e6;
        text-align: center;
    }
    .sku-price-ratio {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 50px;
    }
    .sku-price-ratio {
        margin-right: 10px;
    }
    .sku-price-money {
        width: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 50px;
    }
</style>